package com.ibm.spatiotemp.server.framework.processor.dynamodb;

import java.sql.SQLException;

import com.ibm.spatiotemp.server.connections.ConnectionManager;
import com.ibm.spatiotemp.server.connections.DynamodbConnection;
import com.ibm.spatiotemp.server.datasources.DataSource;
import com.ibm.spatiotemp.server.framework.processor.IndexBuildingProcessor;
import com.ibm.spatiotemp.server.framework.request.Request;

public class DynamodbIndexProcessor extends IndexBuildingProcessor{
	private DynamodbProcessor innerprocessor;
	public DynamodbIndexProcessor(DataSource src) {
		super(src);
		try {
			DynamodbConnection conn = 
					(DynamodbConnection)
					ConnectionManager.GetConnection(src.getConnection_string());
			conn.setRelatedsrc(src);
			innerprocessor = new DynamodbProcessor(conn);
		} catch (SQLException e) {
			logger.error(e);
		}
	}

	@Override
	public String handleIndexBuilding(Request request) {
		return innerprocessor.handleIndexBuilding();
	}

}
